import request from "@/utils/request"

/**
 * 查询账号认证审核状态
 * @param {Object} params
 */
export function authorState(params) {
	return request.get("author/state", {
		params: params
	}).then(res => {
		return res.data
	})
}

/**
 * 发布图片
 * @param {Object} params
 */
export function publishWallPaper(params) {
	return request.post("author/publish_wall_paper", params).then(res => {
		return res.data
	})
}

/**
 * 获取作者信息
 */
export function authorInfo() {
	return request.get("author/info").then(res => {
		return res.data
	})
}

/**
 * 更新作者信息
 * @param {Object} params
 */
export function updateInfo(params) {
	return request.post("author/update", params).then(res => {
		return res.data
	})
}

/**
 * 非鉴权获取
 * @param {Object} params
 */
export function openAuthorInfo(params) {
	return request.get("open/author/info", {
		params: params
	}).then(res => {
		return res.data
	})
}

/**
 * 获取本周汇总数据
 */
export function getCurrentWeek() {
	return request.get("author/current_week").then(res => {
		return res.data
	})
}

/**
 * 获取作者总数据
 */
export function totalData() {
	return request.get("author/total_data").then(res => {
		return res.data
	})
}

/**
 * 用户关注作者
 * @param {Object} params
 */
export function userAttention(params) {
	return request.post("author/attention", params).then(res => {
		return res.data
	})
}

